package com.panfeng.xcloud.common.core.enums;

import lombok.AllArgsConstructor;

/**
 *
 * 开关枚举
 *
 * @author xiaobo
 * @version 1.0
 * @since 2018-12-28
 */
@AllArgsConstructor
public enum SwitchStatusEnum {

    CLOSE((byte) 0, "关闭"), OPEN((byte) 1, "开启");

    public final Byte value;
    public final String desc;

    public static SwitchStatusEnum enumOf(Byte value) {
        for(SwitchStatusEnum e: SwitchStatusEnum.values()) {
            if(e.value.equals(value)) {
                return e;
            }
        }
        return null;
    }
}
